{extend name="public/layer_base" /}
{block name='content'}

<div class="layui-fluid x-admin-sm">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5">
                        <div class="layui-inline layui-show-xs-block">
                            <input value="{$_keywords ? $_keywords : '' ;}" name="_keywords" id="_keywords"
                                class="layui-input" placeholder="昵称/账号">
                        </div>


                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn" type="submit"><i class="layui-icon">&#xe615;</i> 查询</button>
                            <button class="layui-btn  layui-btn-primary" onclick="clearSearchForm()" type="reset"><i
                                    class="layui-icon layui-icon-delete"></i>清空查询</button>
                        </div>
                    </form>
                </div>
                <div class="layui-card-header">
                    <button class="layui-btn" onclick="xadmin.open('添加','{:url('add')}')"><i
                            class="layui-icon"></i>添加</button>
                    <button class="layui-btn layui-btn-danger AjaxButton" data-toggle="tooltip" title="删除选中数据"
                        data-confirm-title="删除确认" data-confirm-content="您确定要删除选中的数据吗？" data-id="checked"
                        data-url="{:url('del')}"><i class="layui-icon"></i>删除</button>
                </div>
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                            <tr>
                                <th>
                                    <input type="checkbox" lay-filter="checkall" name="" lay-skin="primary">
                                </th>
                                <th>ID</th>
                                <th>名称</th>
                                <th>描述</th>
                                <th>作用模块</th>
                                <th>代码</th>
                                <th>排序</th>
                                <th>自动生成菜单</th>
                                <th>自动生成配置文件</th>
                                <th>创建时间</th>
                                <th>更新时间</th>
                                <th>操作</th>

                        </thead>
                        <tbody>
                            {foreach name="data" id="item"}
                            <tr>
                                <td>
                                    <input type="checkbox" onclick="checkThis(this)" name="data-checkbox"
                                        data-id="{$item.id}" class="checkbox" value="{$item.id}" lay-skin="primary"
                                        placeholder="选择/取消">
                                </td>
                                <td>{$item.id}</td>
                                <td>{$item.name}</td>
                                <td>{$item.description}</td>
                                <td>{$item.module}</td>
                                <td>{$item.code}</td>
                                <td>{$item.sort_number}</td>
                                <td>{$item.auto_create_menu_text}</td>
                                <td>{$item.auto_create_file_text}</td>
                                <td>{$item.create_time}</td>
                                <td>{$item.update_time}</td>

                                <td class="td-do">
                                    <button onclick="xadmin.open('修改','{:url('edit',['id'=>$item.id])}')"
                                        href="{:url('edit',['id'=>$item.id])}"
                                        class="layui-btn  layui-bg-blue layui-btn-xs" title="修改">
                                        <i class="layui-icon layui-icon-edit"></i> 修改
                                    </button>


                                    <button class="layui-btn   layui-btn-xs AjaxButton" data-toggle="tooltip" title="生成配置文件"
                                    data-id="{$item.id}" data-confirm-title="生成配置文件确认"
                                    data-confirm-content='您确定要生成ID为 <span class="text-red">{$item.id}</span> 的配置文件吗'
                                    data-url="{:url('file')}">
                                     <i class="fa fa-file-code-o"></i>
                                 </button>
 
                                 <button class="layui-btn   layui-btn-xs  layui-bg-orange AjaxButton" data-toggle="tooltip" title="生成菜单"
                                    data-id="{$item.id}" data-confirm-title="生成菜单确认"
                                    data-confirm-content='您确定要生成ID为 <span class="text-red">{$item.id}</span> 的菜单吗'
                                    data-url="{:url('menu')}">
                                     <i class="fa fa-list"></i>
                                 </button>

                                    <a class="layui-btn layui-btn-danger AjaxButton layui-btn-xs" data-toggle="tooltip"
                                        title="删除" data-id="{$item.id}" data-confirm-title="删除确认"
                                        data-confirm-content='您确定要删除ID为 <span class="text-red">{$item.id}</span> 的数据吗'
                                        data-url="{:url('del')}">
                                        <i class="layui-icon"></i>删除
                                    </a>
                                </td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>

                </div>
                <div class="layui-card-body ">
                    <div id="laypage">
                            共{$total}条
                            <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-1">
                            <span class="layui-laypage-limits">
                                <select lay-ignore="" onchange="changePerPage(this)">
                                    <option value="10" {if $admin.per_page==10}selected{/if}>10 条/页</option>
                                    <option value="30"  {if $admin.per_page==30}selected{/if}>30 条/页</option>
                                    <option value="50"  {if $admin.per_page==50}selected{/if}>50 条/页</option>
                                    <option value="100"  {if $admin.per_page==100}selected{/if}>100 条/页</option>
                                </select>
                            </span>
                            {$page|raw}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {/block}